Commit 8923aa48 authored by 邓春圆's avatar 邓春圆

Merge remote-tracking branch 'origin/dev1.6' into dev1.6

parents fadb60cb e78e0d15
...@@ -70,3 +70,12 @@ export function getCustomerAvailableCouponList(data){ ...@@ -70,3 +70,12 @@ export function getCustomerAvailableCouponList(data){
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>
...@@ -197,11 +199,31 @@ ...@@ -197,11 +199,31 @@
<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() {
// 处理查询参数 // 处理查询参数
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
v-model="form.brand" v-model="form.brand"
:placeholder="$t('可修改')" :placeholder="$t('可修改')"
filterable filterable
remote
@change="handleBrandChange" @change="handleBrandChange"
:remote-method="getProductBrandPage"
clearable> clearable>
<el-option <el-option
v-for="item in brandList" v-for="item in brandList"
...@@ -197,7 +199,9 @@ ...@@ -197,7 +199,9 @@
v-model="form1.brand" v-model="form1.brand"
:placeholder="$t('可修改')" :placeholder="$t('可修改')"
filterable filterable
remote
@change="handleBrandChange" @change="handleBrandChange"
:remote-method="getProductBrandPage"
clearable> clearable>
<el-option <el-option
v-for="item in brandList" v-for="item in brandList"
...@@ -410,17 +414,6 @@ export default { ...@@ -410,17 +414,6 @@ export default {
} }
}, },
mounted() {
getProductBrankPage({pageSize: 100000}).then(r => {
this.brandList = r.data.list.map(e => {
if(e.id){
e.id = e.id.toString()
}
return e
})
})
},
data() { data() {
return { return {
DICT_TYPE, DICT_TYPE,
...@@ -497,6 +490,9 @@ export default { ...@@ -497,6 +490,9 @@ export default {
if (this.warehousing) { if (this.warehousing) {
// this.orderItem = this.warehousing // this.orderItem = this.warehousing
this.inTime = this.warehousing.inTime this.inTime = this.warehousing.inTime
if (!!this.warehousing.brandName){
this.getProductBrandPage(this.warehousing.brandName)
}
} }
} else { } else {
} }
...@@ -535,8 +531,17 @@ export default { ...@@ -535,8 +531,17 @@ export default {
} }
} }
}, },
methods: { methods: {
getProductBrandPage(titleZh = undefined) {
getProductBrankPage({pageSize: 20, titleZh}).then(r => {
this.brandList = r.data.list.map(e => {
if(e.id){
e.id = e.id.toString()
}
return e
})
})
},
handleCancelProcessInstance(){ handleCancelProcessInstance(){
this.$prompt('请输入取消原因?', this.$t("取消流程"), { this.$prompt('请输入取消原因?', this.$t("取消流程"), {
type: 'warning', type: 'warning',
......
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