This commit is contained in:
xvv 2024-09-04 16:23:49 +08:00
parent ab4488c16f
commit 6f65725ca1
3 changed files with 62 additions and 15 deletions

View File

@ -15,6 +15,15 @@ export function getID(id) {
})
}
//修改
export function updateActivePrice(data) {
return request({
url: '/business/activePrice/update',
method: 'post',
data: data
})
}
// 查询oil油号列表
export function getoilList(query) {
return request({
@ -31,3 +40,11 @@ export function postaddList(data) {
data: data
})
}
// 删除分时优惠
export function deleteList(id) {
return request({
url: '/business/activePrice/del/'+id,
method: 'delete',
})
}

View File

@ -68,7 +68,7 @@
</el-table-column>
<el-table-column
align="center"
prop="createBy"
prop="createName"
label="创建人"
>
</el-table-column>
@ -407,7 +407,7 @@
</div>
</template>
<script>
import {getoilList, getRequestList, postaddList, getID} from "./api/separate";
import {getoilList, getRequestList, postaddList, getID,updateActivePrice} from "./api/separate";
import {oilNumberList1} from "@/api/order/oilnumgun";
export default {
@ -450,6 +450,19 @@ export default {
this.getList()
},
methods: {
//
Blank(){
this.ruleForm ={
activeType: 1,
title: '',
name: '',
region: '',
category: '',
disValue: '',
type: [],
oilList: []
}
},
//
modifySeparateList(id) {
getID(id).then(res => {
@ -460,19 +473,35 @@ export default {
}
})
},
//
// /
addSeparateList() {
this.centerDialogVisible = false
postaddList(this.ruleForm).then(res => {
console.log(res)
if (res.code == 200) {
this.$message({
message: '添加成功',
type: 'success'
})
this.getList()
}
})
if(this.ruleForm.id){
updateActivePrice(this.ruleForm).then(res => {
console.log(res)
if (res.code == 200) {
this.$message({
message: '添加成功',
type: 'success'
})
this.getList()
}
})
}else{
postaddList(this.ruleForm).then(res => {
console.log(res)
if (res.code == 200) {
this.$message({
message: '添加成功',
type: 'success'
})
this.getList()
}
})
}
},
//
getList() {
@ -483,6 +512,7 @@ export default {
},
//
Timeshare() {
this.Blank()
oilNumberList1().then(res => {
this.ruleForm.oilList = res.data.records
for (let i = 0; i < this.ruleForm.oilList.length; i++) {

View File

@ -100,8 +100,8 @@ public class ActivePriceController extends BaseController {
* @author PQZ
* @date 11:30 2024/9/2
**/
@DeleteMapping("del")
public ResponseObject del(@RequestParam("id") Integer id) {
@DeleteMapping("del/{id}")
public ResponseObject del(@PathVariable Integer id) {
activePriceService.removeByActId(id);
return getSuccessResult("删除成功", null);
}