...
|
...
|
@@ -46,7 +46,7 @@ |
|
|
</Form>
|
|
|
<div class="add-btn">
|
|
|
<Button v-show="!isEditing && canAdd" type="primary" @click="addPrize">添加</Button>
|
|
|
<Button v-show="isEditing" type="primary" @click="confirmEdit">确认</Button>
|
|
|
<Button v-show="isEditing" type="primary" @click="confirmEdit">暂存</Button>
|
|
|
<Button v-show="canAdd" type="error" @click="savePrize">保存右侧已添加商品</Button>
|
|
|
<Button v-show="needSave && !canAdd" type="error" @click="prizesUpdate">保存修改</Button>
|
|
|
</div>
|
...
|
...
|
@@ -317,19 +317,25 @@ |
|
|
});
|
|
|
},
|
|
|
confirmEdit() {
|
|
|
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(() => {});
|
|
|
this.$Modal.warning({
|
|
|
title: '注意',
|
|
|
content: '暂存之后需要再次点击底部【保存修改】按钮才能完成修改',
|
|
|
cancelText: '取消',
|
|
|
okText: '确定',
|
|
|
onOk: () => {
|
|
|
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(() => {});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
prizesUpdate() {
|
|
|
let len = this.prizes.length;
|
...
|
...
|
|