Authored by 李奇

fixed:奖品编辑

... ... @@ -163,10 +163,10 @@
needSave: false,
prizeRules: {
prize_idx: [
{required: true, message: '奖品位置序号不能为空', trigger: 'blur'}
{required: true, message: '奖品位置序号不能为空'}
],
name: [
{required: true, message: '奖品名称不能为空', trigger: 'blur'}
{required: true, message: '奖品名称不能为空'}
],
type: [
{required: true}
... ... @@ -298,16 +298,29 @@
this.prize = Object.assign({}, this.prizes[idx]);
this.prize._editIdx = idx;
this.isEditing = true;
console.log(JSON.stringify(this.prize))
this.$nextTick(() => {
const form = 'prizeForm';
this.validateForm(form);
});
},
confirmEdit() {
let editIdx = this.prize['_editIdx'];
const form = 'prizeForm';
this.validateForm(form).then(() => {
let editIdx = this.prize['_editIdx'];
delete this.prize._editIdx;
this.prizes.splice(editIdx, 1, Object.assign({}, this.prize));
this.isEditing = false;
this.needSave = true;
this.formReset('prizeForm');
}).catch(() => {});
delete this.prize._editIdx;
this.prizes.splice(editIdx, 1, Object.assign({}, this.prize));
this.isEditing = false;
this.needSave = true;
this.formReset('prizeForm');
},
prizesUpdate() {
let len = this.prizes.length;
... ...