Commit 4b6ed104 by zhangquan

第二轮bug修改

1 parent cbef8533
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
<div class="equity-wrap"> <div class="equity-wrap">
<div class="active-wrap"> <div class="active-wrap">
<span class="title">非会员限时活动/天:</span> <span class="title">非会员限时活动/天:</span>
<FormatInput :intDigit="2" ref="dayRef" :precise="0" :maxVal="30" :minVal="1" :disabled="!isEdit" class="day-input" size="small" @blur="activeDayBlur" v-model="limitedDay"></FormatInput> <FormatInput :intDigit="2" ref="dayRef" :precise="0" :maxVal="30" :minVal="1" :disabled="!isEdit" class="day-input" size="small" v-model="limitedDay"></FormatInput>
<!-- <el-input ref="dayRef" v-model="limitedDay"></el-input> --> <!-- <el-input ref="dayRef" v-model="limitedDay"></el-input> -->
<span class="edit" @click="editDay">编辑</span> <span class="edit" @click="editDay">{{isEdit? '完成' : '编辑'}}</span>
<span class="date" v-if="residueDay>-1">剩余<span class="num">{{residueDay ? residueDay : 1 }}</span>天</span> <span class="date" v-if="residueDay>0">剩余<span class="num">{{residueDay}}</span>天</span>
<span class="date" v-else>已结束</span> <span class="date" v-else>已结束</span>
</div> </div>
<div class="equity-wrap contain"> <div class="equity-wrap contain">
<GLCombiForm ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm :rowNumber="1" ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="operate_wrap"> <div class="operate_wrap">
<span class="table_title"></span> <span class="table_title"></span>
<div class="operate_btn"> <div class="operate_btn">
...@@ -256,6 +256,7 @@ export default { ...@@ -256,6 +256,7 @@ export default {
{ {
label: '下单时间', label: '下单时间',
prop: 'orderStatusName', prop: 'orderStatusName',
width: 220,
formatter: cell => { formatter: cell => {
return cell.orderTime ? this.dateFormat(cell.orderTime, 'YYYY-MM-DD HH:mm:ss') : '--' return cell.orderTime ? this.dateFormat(cell.orderTime, 'YYYY-MM-DD HH:mm:ss') : '--'
} }
...@@ -279,10 +280,14 @@ export default { ...@@ -279,10 +280,14 @@ export default {
return Number((price * amount).toFixed(2)) return Number((price * amount).toFixed(2))
}, },
editDay(){ editDay(){
if(this.isEdit){
this.activeDayBlur()
}else{
this.isEdit=true this.isEdit=true
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs?.dayRef?.$refs?.input?.focus() this.$refs?.dayRef?.$refs?.input?.focus()
}) })
}
}, },
openDetailDialog(row){ openDetailDialog(row){
this.dialogVisible = true this.dialogVisible = true
...@@ -303,7 +308,6 @@ export default { ...@@ -303,7 +308,6 @@ export default {
}, },
activeDayBlur(e){ activeDayBlur(e){
const MAX_DAY = 30 const MAX_DAY = 30
this.isEdit= false
this.$confirm('确认修改活动时长?', '提示', { this.$confirm('确认修改活动时长?', '提示', {
type: 'warning' type: 'warning'
}).then((resp) => { }).then((resp) => {
...@@ -321,24 +325,28 @@ export default { ...@@ -321,24 +325,28 @@ export default {
setTimeout(()=>{ setTimeout(()=>{
this.getActiveDay() this.getActiveDay()
}, 500) }, 500)
}).finally(end =>{
this.isEdit= false
}) })
}, },
getActiveDay(){ getActiveDay(){
this.$apis.equityApi.getHwActiveDayApi({}).then(res => { this.$apis.equityApi.getHwActiveDayApi({}).then(res => {
if(res){ if(res){
console.log(res)
this.limitedDay = res.limitedDay this.limitedDay = res.limitedDay
let nowTime = new Date().getTime() let y = new Date().getFullYear();
let oldTime = new Date(res.updateTime).getTime() let m = new Date().getMonth()+1;
let subtime = (nowTime - oldTime) / 1000; let d = new Date().getDate();
let days = Math.floor(subtime / 86400) let curDayTime = new Date(`${y}/${m}/${d}`).getTime()
let updateTimeArr = res.updateTime?.split(' ')
let updateDayTime = updateTimeArr?.length ? new Date(updateTimeArr[0]?.replace('-','/')).getTime() : ''
if(!updateTimeArr?.length) return;
let days = parseInt(parseInt(updateDayTime - curDayTime) / 86400 / 1000)
this.residueDay = res.limitedDay - (days < 0 ? 0 : days) this.residueDay = res.limitedDay - (days < 0 ? 0 : days)
} }
}) })
}, },
getBrandListFn(){ getBrandListFn(){
this.$apis.equityApi.gethwBrandList({}).then(res => { this.$apis.equityApi.gethwBrandList({}).then(res => {
console.log(res)
if(res?.length) { if(res?.length) {
let brandList = [] let brandList = []
res.forEach((item,index) => { res.forEach((item,index) => {
...@@ -372,7 +380,6 @@ export default { ...@@ -372,7 +380,6 @@ export default {
this.$apis.equityApi.exportHWOrderList(params).then(res => { this.$apis.equityApi.exportHWOrderList(params).then(res => {
if(res?.data){ if(res?.data){
let tempaa = this.getExplorer() let tempaa = this.getExplorer()
console.log(tempaa, res.data)
if (tempaa == 'QQ') { if (tempaa == 'QQ') {
window.open(res.data) window.open(res.data)
} else { } else {
...@@ -391,7 +398,6 @@ export default { ...@@ -391,7 +398,6 @@ export default {
month = month < 10 ? '0'+ month : month month = month < 10 ? '0'+ month : month
let day = today.getDate() let day = today.getDate()
day = day < 10 ? '0'+ day : day day = day < 10 ? '0'+ day : day
console.log(year, month, day)
const params = { const params = {
startTime: `${year}-${month}-${day} 00:00:00`, startTime: `${year}-${month}-${day} 00:00:00`,
endTime: `${year}-${month}-${day} 23:59:59` endTime: `${year}-${month}-${day} 23:59:59`
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!