公司模块second

master
niuniuniu 2023-12-05 20:07:30 +08:00
parent f21fa23252
commit 2544a33651
2 changed files with 19 additions and 35 deletions

View File

@ -2,47 +2,33 @@ import request from '@/utils/request'
export function getFirmList(form) { export function getFirmList(form) {
return request({ return request({
url: '/firm/company/firm/firmInfoList', url: '/company/company/firm/firmInfoList',
method: 'post', method: 'post',
data:form data:form
}) })
} }
export function delCar(firmId) { export function delFirm(firmId) {
return request({ return request({
url: '/firm?firmId='+firmId, url: '/company/company/firm?firmId='+firmId,
method: 'post' method: 'post'
}) })
} }
export function updateCar(carForm) { export function updateFirm(firmForm) {
return request({ return request({
url: '/history/car/updateCar', url: '/company/company/firm/update',
method: 'post', method: 'post',
data:carForm data:firmForm
}) })
} }
export function insertCar(carInsert) { export function insertFirm(firmInsert) {
return request({ return request({
url: '/history/car/insertCar', url: '/company/company/firm/',
method: 'post', method: 'post',
data:carInsert data:firmInsert
}) })
} }
export function getList() {
return request({
url: '/history/listHistoricalTrack',
method: 'get'
})
}
export function deleteRecord(recordId) {
return request({
url: '/history/delHistoricalTrack?recordId='+recordId,
method: 'post',
data:recordId
})
}

View File

@ -133,7 +133,7 @@
<el-table-column label="操作"> <el-table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="primary" @click="updateFirmList(scope.row)"></el-button> <el-button type="primary" @click="updateFirmList(scope.row)"></el-button>
<el-button type="primary" @click="delCar(scope.row.carVin)"></el-button> <el-button type="primary" @click="delfirm(scope.row.firmId)"></el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -205,7 +205,7 @@
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="updateCar"></el-button> <el-button type="primary" @click="updatefirm"></el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-button type="primary" @click="tapInsert"></el-button> <el-button type="primary" @click="tapInsert"></el-button>
@ -279,7 +279,7 @@
</template> </template>
<script> <script>
import {getFirmList} from "@/api/firmtable"; import { delFirm, getFirmList, insertFirm, updateFirm } from '@/api/firmtable'
export default { export default {
data() { data() {
return { return {
@ -386,28 +386,26 @@ export default {
this.form.pageNum=val this.form.pageNum=val
this.getList() this.getList()
}, },
/*车辆列表*/ /*企业列表*/
getList(){ getList(){
getFirmList(this.form).then(response => { getFirmList(this.form).then(response => {
console.log(response) console.log(response)
this.firmList = response.data.list this.firmList = response.data.list
this.total = response.data.total this.total = response.data.total
}).catch(err=>{ this.rows=response.data.rows
this.$message.error(err.message)
console.log(err);
}) })
}, },
delCar(carVin){ delfirm(firmId){
this.carVin = carVin this.firmId = firmId
delCar(this.carVin).then(res=>{ delFirm(this.firmId).then(res=>{
if(res.code === 200){ if(res.code === 200){
this.$message.success("删除成功!") this.$message.success("删除成功!")
location.reload() location.reload()
} }
}) })
}, },
updateCar(){ updatefirm(){
updateCar(this.carForm).then(res=>{ updateFirm(this.firmForm).then(res=>{
if(res.code === 200){ if(res.code === 200){
this.$message.success("修改成功!") this.$message.success("修改成功!")
location.reload() location.reload()