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

View File

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