This commit is contained in:
cun-nan 2024-03-11 10:05:46 +08:00
parent 3645e64d6f
commit 50a2c9c9a0
5 changed files with 76 additions and 14 deletions

View File

@ -42,6 +42,15 @@ export function updateActiveFullminus(data) {
})
}
// 修改满减营销
export function editActiveFullminus(data) {
return request({
url: '/business/marketingActivity/activeFullminus/edit',
method: 'post',
data: data
})
}
// 删除满减营销
export function delActiveFullminus(id) {
return request({

View File

@ -262,8 +262,20 @@
</template>
<script>
import { listActiveFullminus, getActiveFullminus, delActiveFullminus, addActiveFullminus, updateActiveFullminus } from "@/api/EventMarketing/activeFullminus";
import {delActiveDiscount, getActiveDiscount, updateActiveDiscount} from "@/api/EventMarketing/activeDiscount";
import {
listActiveFullminus,
getActiveFullminus,
delActiveFullminus,
addActiveFullminus,
updateActiveFullminus,
editActiveFullminus
} from "@/api/EventMarketing/activeFullminus";
import {
delActiveDiscount,
editActiveDiscount,
getActiveDiscount,
updateActiveDiscount
} from "@/api/EventMarketing/activeDiscount";
import {getoilName, looklook, looklooklook} from "@/api/EventMarketing/activeConsumption";
import {listUserGrade} from "@/api/staff/user/usergrade";
import {getOilNameList} from "@/api/order/oilnumgun";
@ -500,17 +512,24 @@ export default {
});
},
handleDeletexia(row){
getActiveFullminus(row.id).then(response => {
// this.form = response.data;
let data = response.data
data.isonline = 1
updateActiveFullminus(data).then(response => {
this.$modal.msgSuccess("下线成功");
this.open = false;
this.getList();
});
});
// getActiveFullminus(row.id).then(response => {
// // this.form = response.data;
// let data = response.data
// data.isonline = 1
// updateActiveFullminus(data).then(response => {
// this.$modal.msgSuccess("线");
// this.open = false;
// this.getList();
// });
//
// });
this.$modal.confirm('确定下线此条修改满减营销活动信息?').then(function() {
return editActiveFullminus({id:row.id,isonline:1});
}).then(() => {
this.$modal.msgSuccess("下线成功");
this.open = false;
this.getList();
}).catch(() => {});
},
qiyong(row){
if(row.isonline == 1){
@ -584,7 +603,7 @@ export default {
},
Deleteshan(row){
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除消费有礼活动编号为"' + ids + '"的数据项').then(function() {
this.$modal.confirm('是否确认删除此条修改满减营销活动信息').then(function() {
return delActiveFullminus(ids);
}).then(() => {
this.getList();

View File

@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* 满减营销表(ActiveFullminus)表控制层
@ -81,6 +82,19 @@ public class ActiveFullminusController extends BaseController {
return getSuccessResult(this.activeFullminusService.add(activeFullminusDTO));
}
/**
* 修改数据
*
* @param map 实体对象
* @return 修改结果
*/
@PostMapping("/edit")
public ResponseObject updateIsOnline(@RequestBody Map<String,String> map) {
Integer id = Integer.valueOf(map.get("id"));
String isonline = map.get("isonline");
return getSuccessResult(this.activeFullminusService.updateIsOnlone(id,isonline));
}
/**
* 修改数据
*

View File

@ -48,6 +48,14 @@ public interface ActiveFullminusService extends IService<ActiveFullminus> {
*/
Boolean updateOneById(ActiveFullminusDTO activeFullminusDTO);
/**
* 修改下线
* @param id
* @param isonline
* @return
*/
Boolean updateIsOnlone(Integer id,String isonline);
/**
* 查询所有数据(小程序端)
* @param activeFullminus

View File

@ -237,6 +237,18 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
return update;
}
@Override
public Boolean updateIsOnlone(Integer id, String isonline) {
int row = 0;
ActiveFullminus activeFullminus = baseMapper.selectById(id);
if (ObjectUtil.isNotEmpty(activeFullminus)){
activeFullminus.setStatus("1");
activeFullminus.setIsonline(isonline);
row = baseMapper.updateById(activeFullminus);
}
return row == 1;
}
/**
* 查询所有数据(小程序端)
* @param activeFullminus