|
@@ -173,7 +173,7 @@
|
|
|
</div>
|
|
|
<!-- 保存 -->
|
|
|
<div class="save-btn">
|
|
|
- <el-button size="small"> 取 消 </el-button>
|
|
|
+ <el-button size="small" @click="back"> 取 消 </el-button>
|
|
|
<div class="ge"></div>
|
|
|
<el-button type="primary" size="small" @click="submitForm">
|
|
|
保 存
|
|
@@ -581,13 +581,15 @@ export default {
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- let prizeIndex = this.awardsList.findIndex(item=>{
|
|
|
- return !item.prizeList.length
|
|
|
- })
|
|
|
+ let prizeIndex = this.awardsList.findIndex((item) => {
|
|
|
+ return !item.prizeList.length;
|
|
|
+ });
|
|
|
// 判断没有设置奖品的奖级
|
|
|
- if(prizeIndex != -1){
|
|
|
- this.$message.error(`请设置${ this.awardsList[prizeIndex].name }的奖品!`);
|
|
|
- return
|
|
|
+ if (prizeIndex != -1) {
|
|
|
+ this.$message.error(
|
|
|
+ `请设置${this.awardsList[prizeIndex].name}的奖品!`
|
|
|
+ );
|
|
|
+ return;
|
|
|
}
|
|
|
this.awardsList.forEach((item) => {
|
|
|
item.prizeList = item.prizeList.map((ele) => {
|
|
@@ -615,10 +617,10 @@ export default {
|
|
|
background: "rgba(0, 0, 0, 0.4)",
|
|
|
});
|
|
|
ticketBoxCreate(data).then((res) => {
|
|
|
- if(res.code == 0){
|
|
|
- this.msgSuccess('保存成功')
|
|
|
- this.$store.dispatch('tagsView/delView', this.$route)
|
|
|
- this.$router.go(-1)
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.msgSuccess("保存成功");
|
|
|
+ this.$store.dispatch("tagsView/delView", this.$route);
|
|
|
+ this.$router.go(-1);
|
|
|
loading.close();
|
|
|
}
|
|
|
});
|
|
@@ -743,6 +745,12 @@ export default {
|
|
|
});
|
|
|
this.awardsList[this.prizeIndex].quantity = num;
|
|
|
},
|
|
|
+
|
|
|
+ // 取消
|
|
|
+ back() {
|
|
|
+ this.$store.dispatch("tagsView/delView", this.$route);
|
|
|
+ this.$router.go(-1);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|