|
|
@@ -97,7 +97,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { selectAll, save, del } from '@/api/comboMeal/index'
|
|
|
+import { selectAll, save, del,edit } from '@/api/comboMeal/index'
|
|
|
// import lookDetail from './lookDetail.vue';
|
|
|
// import trainDetatil from './trainDetatil.vue';
|
|
|
export default {
|
|
|
@@ -159,7 +159,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
handleStatus(e, status) {
|
|
|
- save({ id: e.id, status: status }).then(response => {
|
|
|
+ edit({ id: e.id, status: status }).then(response => {
|
|
|
this.$modal.msgSuccess(status == 0 ? `启用成功` : '停用成功');
|
|
|
this.getList();
|
|
|
});
|
|
|
@@ -267,11 +267,20 @@ export default {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
let catchForm = this.form
|
|
|
- save(catchForm).then(res => {
|
|
|
- this.$modal.msgSuccess(catchForm.id ? '修改成功' : '添加成功');
|
|
|
- this.open = false
|
|
|
- this.getList()
|
|
|
- })
|
|
|
+ if(catchForm.id === null || catchForm.id === undefined || catchForm.id === "") {
|
|
|
+ save(catchForm).then(res => {
|
|
|
+ this.$modal.msgSuccess(catchForm.id ? '修改成功' : '添加成功');
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ edit(catchForm).then(res => {
|
|
|
+ this.$modal.msgSuccess(catchForm.id ? '修改成功' : '添加成功');
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
},
|