Commit abdce3bd authored by dragondean@qq.com's avatar dragondean@qq.com

公海标识和优惠延期

parent cec5e442
...@@ -69,4 +69,13 @@ export function getCustomerAvailableCouponList(data){ ...@@ -69,4 +69,13 @@ export function getCustomerAvailableCouponList(data){
method: 'post', method: 'post',
data data
}) })
}
// 更新优惠券有效期
export function updateEndtime(data){
return request({
url: '/product/coupon/update/endTime',
method: 'put',
data
})
} }
\ No newline at end of file
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<div class="line"> <div class="line">
<div class="label">{{$t('姓名')}}</div> <div class="label">{{$t('姓名')}}</div>
<div class="value">{{item.contactsName}}</div> <div class="value">{{item.contactsName}}</div>
<el-tag v-if="item.isInOpenSea" type="danger" effect="dark">{{$t('')}}</el-tag>
</div> </div>
<div class="line"> <div class="line">
<div class="label">{{$t('电话')}}</div> <div class="label">{{$t('电话')}}</div>
......
...@@ -188,6 +188,8 @@ ...@@ -188,6 +188,8 @@
v-hasPermi="['ecw:coupon:update']">{{ $t('编辑') }}</el-button> v-hasPermi="['ecw:coupon:update']">{{ $t('编辑') }}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleCopy(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleCopy(scope.row)"
v-hasPermi="['ecw:coupon:create']">{{ $t('复制') }}</el-button> v-hasPermi="['ecw:coupon:create']">{{ $t('复制') }}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="updateEndtimeItem = scope.row"
v-hasPermi="['ecw:coupon:update']">{{ $t('延期') }}</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:coupon:delete']">{{ $t('删除') }}</el-button> v-hasPermi="['ecw:coupon:delete']">{{ $t('删除') }}</el-button>
</template> </template>
...@@ -196,12 +198,32 @@ ...@@ -196,12 +198,32 @@
<!-- 分页组件 --> <!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/> @pagination="getList"/>
<el-dialog :title="$t('延期活动时间')" :visible="!!updateEndtimeItem" :before-close="() => updateEndtimeItem=null">
<div v-if="updateEndtimeItem">
{{$t('优惠活动“{name}”的当前结束时间:{time}',{
name: updateEndtimeItem.name,
time: updateEndtimeItem.endTime || $t('永久有效')
})}}
</div>
<div>{{$t('请问您确定延长活动吗?')}}</div>
<el-form :model="updateEndtimeForm" :rules="updateEndtimeRules" label-position="left" >
<el-form-item :label="$t('活动结束时间')" prop="endTime">
<el-date-picker type="datetime" value-format="yyyy-MM-dd HH:mm:ss" v-model="updateEndtimeForm.endTime" placeholder=""></el-date-picker>
<el-checkbox :label="$t('永久有效')" v-model="updateEndtimeForm.forever" class="ml-10"></el-checkbox>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="updateEndtime">{{$t('确定')}}</el-button>
<el-button type="default" @click="updateEndtimeItem = null">{{$t('取消')}}</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { createCoupon, updateCoupon, deleteCoupon, getCoupon, getCouponPage, exportCouponExcel } from "@/api/ecw/coupon"; import { createCoupon, updateCoupon, deleteCoupon, getCoupon, getCouponPage, exportCouponExcel, updateEndtime } from "@/api/ecw/coupon";
export default { export default {
name: "EcwCouponIndex", name: "EcwCouponIndex",
...@@ -260,9 +282,20 @@ export default { ...@@ -260,9 +282,20 @@ export default {
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
} },
updateEndtimeItem: null, // 延期操作的数据
updateEndtimeForm:{} // 延长有效期的表单数据
}; };
}, },
computed:{
updateEndtimeRules(){
return {
endTime: [
{required: !this.updateEndtimeForm.forever, message: "请填写结束时间"}
]
}
}
},
created() { created() {
this.getList(); this.getList();
}, },
...@@ -331,6 +364,18 @@ export default { ...@@ -331,6 +364,18 @@ export default {
this.$message.success(this.$t("删除成功")); this.$message.success(this.$t("删除成功"));
}).catch(() => {}); }).catch(() => {});
}, },
// 延期
updateEndtime(){
if(!this.updateEndtimeForm.forever && !this.updateEndtimeForm.endTime){
return this.$message.error(this.$t("请填写结束时间"))
}
let form = {couponId: this.updateEndtimeItem.couponId, ...this.updateEndtimeForm}
form.isValidity = !form.forever // 是否设置有效期
updateEndtime(form).then(res => {
this.getList()
this.updateEndtimeItem = null
})
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// 处理查询参数 // 处理查询参数
......
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